import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.Scanner;

public class DAY0314 {
    //二分查找
    public int search(int[] nums, int target) {
        int left=0;
        int right=nums.length-1;
        while(left<=right){
            int mid=(right-left)/2+left;
            if(nums[mid]==target){
                return mid;
            } else if (nums[mid]>target) {
                right=mid-1;
            } else if (nums[mid]<target) {
                left=mid+1;
            }
        }
        return -1;
    }
    public boolean containsDuplicate(int[] nums) {
        Arrays.sort(nums);
        for (int i = 0; i < nums.length; i++) {
            if(nums[i]==nums[i+1]){
                return true;
            }
        }
        return false;
    }

    public int maxSubArray(int[] nums) {
        int pre=0;
        int ansMax=nums[0];
        for (int i : nums) {
            pre=Math.max(pre+i,i);
            ansMax=Math.max(ansMax,pre);
        }
        return ansMax;
    }

    public static void main1(String[] args) {
        String string = "H e l l o ! n o w c o d e r";
        Scanner scanner= new Scanner(System.in);
        String word = scanner.next();
        scanner.close();
        System.out.println(check(string, word));
    }

    public static int check(String str, String word) {

        //write your code here......
        return str.length()-str.replace(word,"").length();
    }

    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();

        //write your code here......
        System.out.println(Integer.toBinaryString(num));

    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int seed = scanner.nextInt();
            Random random = new Random(seed);

            //write your code here......
            System.out.println(random.nextInt(6)+1);

        }
    }

    public static void main3(String[] args) {
        Scanner console = new Scanner(System.in);
        int year = console.nextInt();

        //write your code here......
        int[] day={31,28,31,30,31,30,31,31,30,31,30,31};
        for(int i=0;i<12;i++){
            if((year%4==0&&year%100!=0)||(year%400==0)){
                day[1]=29;
            }
            System.out.println(year+"年"+(i+1)+"月:"+day[i]+"天");
        }

    }


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {// 注意，如果输入是多个测试用例，请通过while循环处理多个测试用例
            int n = in.nextInt();
            int m = in.nextInt();
            System.out.println(QiPanGe(n,m));
        }
    }
    public static int QiPanGe(int n,int m){
        if((n==1&&m==2)||(n==2&&m==1)){
            return 3;
        }
        if(n==1&&m==1){
            return 2;
        }
        if(n==0||m==0){
            return 1;
        }
        return QiPanGe(n-1,m)+QiPanGe(n,m-1);
    }

}
